#ifndef SCREENBASE_H
#define SCREENBASE_H

#include <list>
#include <vector>
#include "SFML\Graphics\RenderWindow.hpp"
#include "Camera.h"
#include "Objects/GameObject.h"

class GameState;
class Particle;

const int MAX_PARTICLES = 2000;

class ScreenBase{
public:
	ScreenBase(GameState *gameState);
	virtual ~ScreenBase();

	virtual void init();
	virtual void update(double dt);
	virtual void draw();
	virtual void addObject(GameObject* object, int layer = -1);
	virtual void clean();

	Particle* createParticle();

	double getTime(){ return m_time; }

protected:
	GameState *m_gameState;

	// Object handling
	static const int MAX_LAYERS = 10;

	list<GameObject*> m_objects;

	vector<list<GameObject*>> m_objectLayers;

	unsigned int m_nextId;

	// Particles
	Particle* m_particles[MAX_PARTICLES];

	int m_currentParticle;

	double m_time;
};

#endif